// 车辆管理接口
import { service } from '@/utils/request'

// 状态
export const getVehicleAPI = () => {
  return service.get('/count')
}

// 获取总数据
export const getVehiclePageAPI = (params) => {
  return service.get('/truck/page', {
    params
  })
}

// 获取车辆类型信息列表
export const truckTypeAPI = () => {
  return service.get('/truckType/simple')
}

// 新增车辆
export const truckAddAPI = (data) => {
  return service.post('/truck', data)
}

// 车辆详情
export const truckDetailsAPI = (id) => {
  return service.get(`/truck/${id}`)
}

// 编辑车辆
export const truckDeitAPI = (id, data) => {
  return service.put(`/truck/${id}`, data)
}

// 获取车辆行驶证详情
export const getLicenseAPI = (id) => {
  return service.get(`/truck/${id}/license`)
}

// 保存车辆行驶证信息
export const addLicenseAPI = (id, data) => {
  return service.post(`/truck/${id}/license`, data)
}

// 启动车辆
export const startAPI = (id) => {
  return service.put(`/enable/${id}`)
}

// 获取未绑定车辆的司机
export const bindingAPI = (id) => {
  return service.get(`/bindingDrivers/${id}`)
}
